<?php

session_start();


?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<title>Halaman Login</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Login Koperasi</title>
<link href="css/twitter-bootstrap/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/login.css" />

</head>
<body>
    <div class="navbar navbar-inverse">
    <div class="navbar-inner">
    <a class="brand" href="#">Incofarming</a>
    <ul class="nav">
    <li class="active"><a href="#">Login</a></li>
    </ul>
    </div>
    </div>

<div>
	<?php
	if(isset($_SESSION['err_msg'])) {
		echo $_SESSION['err_msg'];
		session_destroy();
	}
	else if(isset($_SESSION['id_user'])){
		if ($_SESSISON['id_priv'] == 1){
			header("../Functions/koperasi/dashkop.php");
		}
		else{
			header("../Functions/admin/dashboard-admin.php");
		}
	}
	?>
	
	
</div>	

<form method="post" action="/incofarming/Functions/login.php" class="horizontal">
<div class="container">
		<div class="content">
			<div class="row">
				<div class="login-form">
					<h2>Login Koperasi</h2>
					<form action="/Functions/login.php" method="post">
						<fieldset>
							<div class="clearfix">
							<label class="control-label" for="username">Username</label>
								<input type="text" placeholder="Username" name="user" required>								
							</div>
							<div class="clearfix">
							<label class="control-label" for="password">Password</label>
								<input type="password" placeholder="Password" name="pass" required>
							</div>
							<button class="btn primary" type="submit" name="login">Sign in</button>
                            </fieldset>
					</form>
				</div>
			</div>
		</div>
	</div> 
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
